//
//  XNBillCountRequest.m
//  XINNingOA
//
//  Created by 葛承铭 on 2021/7/11.
//

#import "XNBillCountRequest.h"
#import "XNBillCountModel.h"

@implementation XNBillCountRequest

- (NSString *)requestUrl
{
    return @"/api/Signed/GetBillCountByAccount";
}

- (YTKRequestMethod)requestMethod{
    return YTKRequestMethodGET;
}

- (id)requestArgument
{
    return @{
        @"account":[[NSUserDefaults standardUserDefaults] objectForKey:@"account"],
    };
}



-(NSArray<XNBillCountModel *> *)billArray
{
    NSDictionary *response = [self responseJSONObject];
    if (self.success) {
        NSMutableArray *bills = [NSMutableArray array];
        NSArray *array = response[@"result"][@"data"];
        [array enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL * _Nonnull stop) {
            XNBillCountModel *bill = [XNBillCountModel modelWithDictionary:obj];
            [bills addObject:bill];
        }];
        return [NSArray arrayWithArray:bills];
        
    }else{
        return nil;
    }
}




@end
